import request from '@/utils/request'

// 根据id查询记录
export const getRoleById = (id) =>
  request({
    url: `/sys/role/${id}`,
    method: 'get'
  })

// 分页查询
export const listRolePage = (search) =>
  request({
    url: '/sys/role/list',
    method: 'post',
    data: search
  })

// 查询所有记录
export const listRoleAll = (search) =>
  request({
    url: '/sys/role/listAll',
    method: 'post',
    data: search
  })

// 保存/更新记录
export const saveRole = (role) =>
  request({
    url: '/sys/role/save',
    method: 'post',
    data: role
  })

// 删除记录
export const deleteRole = (role) =>
  request({
    url: '/sys/role/delete',
    method: 'post',
    data: role
  })

// 批量保存/更新记录
export const bulkInsertRole = (roles) =>
  request({
    url: '/sys/role/bulkInsert',
    method: 'post',
    data: roles
  })

// 批量更新记录
export const bulkUpdateRole = (roles) =>
  request({
    url: '/sys/role/bulkUpdate',
    method: 'post',
    data: roles
  })

// 批量删除记录
export const bulkDeleteRole = (roles) =>
  request({
    url: '/sys/role/bulkDelete',
    method: 'post',
    data: roles
  }) 